#include <iostream>

using namespace std;

typedef long long LL;

const int N = 61;
LL f[N];
int n;

int main()
{
	cin >> n;
	f[0] = 1; f[1] = 1; f[2] = 2;
	for(int i = 2; i <= n; i++)
	{
		f[i] = f[i - 1] + f[i - 2] + f[i - 3];
	}
	
	cout << f[n] << endl;
	
	return 0;
}
